<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Tk_WindowId manual page - Tk Library Procedures</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk C API</a> <small>&gt;</small> WindowId</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="WindowId.htm#M2" NAME="L647">NAME</A>
<DL><DD>Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp &mdash; retrieve information from Tk's local data structure</DD></DL>
<DD><A HREF="WindowId.htm#M3" NAME="L648">SYNOPSIS</A>
<DL>
<DD><B>#include &lt;tk.h&gt;</B>
<DD>Window
<DD><B>Tk_WindowId</B>(<I>tkwin</I>)
<DD>Tk_Window
<DD><B>Tk_Parent</B>(<I>tkwin</I>)
<DD>Display *
<DD><B>Tk_Display</B>(<I>tkwin</I>)
<DD>const char *
<DD><B>Tk_DisplayName</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_ScreenNumber</B>(<I>tkwin</I>)
<DD>Screen *
<DD><B>Tk_Screen</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_X</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_Y</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_Width</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_Height</B>(<I>tkwin</I>)
<DD>XWindowChanges *
<DD><B>Tk_Changes</B>(<I>tkwin</I>)
<DD>XSetWindowAttributes *
<DD><B>Tk_Attributes</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_IsContainer</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_IsEmbedded</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_IsMapped</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_IsTopLevel</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_ReqWidth</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_ReqHeight</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_MinReqWidth</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_MinReqHeight</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_InternalBorderLeft</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_InternalBorderRight</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_InternalBorderTop</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_InternalBorderBottom</B>(<I>tkwin</I>)
<DD>Visual *
<DD><B>Tk_Visual</B>(<I>tkwin</I>)
<DD>int
<DD><B>Tk_Depth</B>(<I>tkwin</I>)
<DD>Colormap
<DD><B>Tk_Colormap</B>(<I>tkwin</I>)
<DD>Tcl_Interp *
<DD><B>Tk_Interp</B>(<I>tkwin</I>)
</DL>
<DD><A HREF="WindowId.htm#M4" NAME="L649">ARGUMENTS</A>
<DL class="arguments">
</DL>
<DD><A HREF="WindowId.htm#M5" NAME="L650">DESCRIPTION</A>
<DD><A HREF="WindowId.htm#M6" NAME="L651">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp &mdash; retrieve information from Tk's local data structure
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>#include &lt;tk.h&gt;</B><BR>
Window<BR>
<B>Tk_WindowId</B>(<I>tkwin</I>)<BR>
Tk_Window<BR>
<B>Tk_Parent</B>(<I>tkwin</I>)<BR>
Display *<BR>
<B>Tk_Display</B>(<I>tkwin</I>)<BR>
const char *<BR>
<B>Tk_DisplayName</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_ScreenNumber</B>(<I>tkwin</I>)<BR>
Screen *<BR>
<B>Tk_Screen</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_X</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_Y</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_Width</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_Height</B>(<I>tkwin</I>)<BR>
XWindowChanges *<BR>
<B>Tk_Changes</B>(<I>tkwin</I>)<BR>
XSetWindowAttributes *<BR>
<B>Tk_Attributes</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_IsContainer</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_IsEmbedded</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_IsMapped</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_IsTopLevel</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_ReqWidth</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_ReqHeight</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_MinReqWidth</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_MinReqHeight</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_InternalBorderLeft</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_InternalBorderRight</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_InternalBorderTop</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_InternalBorderBottom</B>(<I>tkwin</I>)<BR>
Visual *<BR>
<B>Tk_Visual</B>(<I>tkwin</I>)<BR>
int<BR>
<B>Tk_Depth</B>(<I>tkwin</I>)<BR>
Colormap<BR>
<B>Tk_Colormap</B>(<I>tkwin</I>)<BR>
<A HREF="../TclLib/Interp.htm">Tcl_Interp</A> *<BR>
<B>Tk_Interp</B>(<I>tkwin</I>)<BR>
<H3><A NAME="M4">ARGUMENTS</A></H3>
<DL class="arguments">
<DT>Tk_Window <B>tkwin</B> (in)<DD>
Token for window.
<P></DL>
<H3><A NAME="M5">DESCRIPTION</A></H3>
<B>Tk_WindowId</B> and the other names listed above are
all macros that return fields from Tk's local data structure
for <I>tkwin</I>.  None of these macros requires any
interaction with the server;  it is safe to assume that
all are fast.
<P>
<B>Tk_WindowId</B> returns the X identifier for <I>tkwin</I>,
or <B>NULL</B> if no X window has been created for <I>tkwin</I>
yet.
<P>
<B>Tk_Parent</B> returns Tk's token for the logical parent of
<I>tkwin</I>.  The parent is the token that was specified when
<I>tkwin</I> was created, or NULL for main windows.
<P>
<B>Tk_Interp</B> returns the Tcl interpreter associated with a
<I>tkwin</I> or NULL if there is an error.
<P>
<B>Tk_Display</B> returns a pointer to the Xlib display structure
corresponding to <I>tkwin</I>.  <B>Tk_DisplayName</B> returns an
ASCII string identifying <I>tkwin</I>'s display.  <B>Tk_ScreenNumber</B>
returns the index of <I>tkwin</I>'s screen among all the screens
of <I>tkwin</I>'s display.  <B>Tk_Screen</B> returns a pointer to
the Xlib structure corresponding to <I>tkwin</I>'s screen.
<P>
<B>Tk_X</B>, <B>Tk_Y</B>, <B>Tk_Width</B>, and <B>Tk_Height</B>
return information about <I>tkwin's</I> location within its
parent and its size.  The location information refers to the
upper-left pixel in the window, or its border if there is one.
The width and height information refers to the interior size
of the window, not including any border.  <B>Tk_Changes</B>
returns a pointer to a structure containing all of the above
information plus a few other fields.  <B>Tk_Attributes</B>
returns a pointer to an XSetWindowAttributes structure describing
all of the attributes of the <I>tkwin</I>'s window, such as background
pixmap, event mask, and so on (Tk keeps track of all this information
as it is changed by the application).  Note: it is essential that
applications use Tk procedures like <B><A HREF="../TkLib/ConfigWind.htm">Tk_ResizeWindow</A></B> instead
of X procedures like <B>XResizeWindow</B>, so that Tk can keep its
data structures up-to-date.
<P>
<B>Tk_IsContainer</B> returns a non-zero value if <I>tkwin</I>
is a container, and that some other application may be embedding
itself inside <I>tkwin</I>.
<P>
<B>Tk_IsEmbedded</B> returns a non-zero value if <I>tkwin</I>
is not a free-standing window, but rather is embedded in some
other application.
<P>
<B>Tk_IsMapped</B> returns a non-zero value if <I>tkwin</I>
is mapped and zero if <I>tkwin</I> is not mapped.
<P>
<B>Tk_IsTopLevel</B> returns a non-zero value if <I>tkwin</I>
is a top-level window (its X parent is the root window of the
screen) and zero if <I>tkwin</I> is not a top-level window.
<P>
<B>Tk_ReqWidth</B> and <B>Tk_ReqHeight</B> return information about
the window's requested size.  These values correspond to the last
call to <B><A HREF="../TkLib/GeomReq.htm">Tk_GeometryRequest</A></B> for <I>tkwin</I>.
<P>
<B>Tk_MinReqWidth</B> and <B>Tk_MinReqHeight</B> return information about
the window's minimum requested size.  These values correspond to the last
call to <B><A HREF="../TkLib/GeomReq.htm">Tk_SetMinimumRequestSize</A></B> for <I>tkwin</I>.
<P>
<B>Tk_InternalBorderLeft</B>, <B>Tk_InternalBorderRight</B>,
<B>Tk_InternalBorderTop</B> and <B>Tk_InternalBorderBottom</B>
return the width of one side of the internal border
that has been requested for <I>tkwin</I>, or 0 if no internal border was
requested.  The return value is simply the last value passed to
<B><A HREF="../TkLib/GeomReq.htm">Tk_SetInternalBorder</A></B> or <B><A HREF="../TkLib/GeomReq.htm">Tk_SetInternalBorderEx</A></B> for <I>tkwin</I>.
<P>
<B>Tk_Visual</B>, <B>Tk_Depth</B>, and <B>Tk_Colormap</B> return
information about the visual characteristics of a window.
<B>Tk_Visual</B> returns the visual type for
the window, <B>Tk_Depth</B> returns the number of bits per pixel,
and <B>Tk_Colormap</B> returns the current
colormap for the window.  The visual characteristics are
normally set from the defaults for the window's screen, but
they may be overridden by calling <B><A HREF="../TkLib/SetVisual.htm">Tk_SetWindowVisual</A></B>.
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#attributes">attributes</A>, <A href="../Keywords/C.htm#colormap">colormap</A>, <A href="../Keywords/D.htm#depth">depth</A>, <A href="../Keywords/D.htm#display">display</A>, <A href="../Keywords/H.htm#height">height</A>, <A href="../Keywords/G.htm#geometry manager">geometry manager</A>, <A href="../Keywords/I.htm#identifier">identifier</A>, <A href="../Keywords/M.htm#mapped">mapped</A>, <A href="../Keywords/R.htm#requested size">requested size</A>, <A href="../Keywords/S.htm#screen">screen</A>, <A href="../Keywords/T.htm#top-level">top-level</A>, <A href="../Keywords/V.htm#visual">visual</A>, <A href="../Keywords/W.htm#width">width</A>, <A href="../Keywords/W.htm#window">window</A>, <A href="../Keywords/X.htm#x">x</A>, <A href="../Keywords/Y.htm#y">y</A>
<div class="copy">Copyright &copy; 1990-1993 The Regents of the University of California.
<BR>Copyright &copy; 1994-1997 Sun Microsystems, Inc.
</div>
</BODY></HTML>
